/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddGroup;
/*     */ import com.newcrm.webapi.sub.DeleteGroup;
/*     */ import com.newcrm.webapi.sub.ListGroups;
/*     */ import com.newcrm.webapi.sub.ShowUpdateGroup;
/*     */ import com.newcrm.webapi.sub.UpdateGroup;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class Groups extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = 1182198630593472412L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  47 */     if (!checkLogin(request)) {
/*  48 */       super.showLoginPage(request, response);
/*  49 */       return;
/*     */     }
/*     */ 
/*  53 */     if (!super.getLoginUser(request).isAdmin) {
/*  54 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  55 */         request, response);
/*  56 */       return;
/*     */     }
/*     */ 
/*  59 */     String url = request.getRequestURI();
/*  60 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try
/*     */     {
/*  63 */       String operation = Util.getURLParameter(request
/*  64 */         .getParameter("operation"));
/*  65 */       if (((param == null) || (param.length == 0)) && (
/*  66 */         (operation == null) || (operation.trim().length() == 0))) {
/*  67 */         new ListGroups(this).parse(request, response);
/*  68 */         return;
/*     */       }
/*     */ 
/*  72 */       if ((param != null) && (param.length == 1)) {
/*  73 */         if ("new".equals(param[0])) {
/*  74 */           request.getRequestDispatcher("/groups_new.jsp").forward(
/*  75 */             request, response);
/*  76 */           return;
/*     */         }
/*  78 */         if ("add".equals(param[0])) {
/*  79 */           new AddGroup(this).parse(request, response);
/*  80 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/*  84 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/*  85 */         response);
/*  86 */       return;
/*     */     }
/*  88 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/*  93 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/*  98 */     return new DeleteGroup(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 103 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 108 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 113 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 118 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 123 */     return new ShowUpdateGroup(this, id);
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 128 */     return "/groups";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 133 */     return new UpdateGroup(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.Groups
 * JD-Core Version:    0.6.1
 */